<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增风险名称')" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-hiddenName-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">风险编码：</label>
                <div class="col-sm-8">
                    <input name="riskCode" class="form-control" type="text" required value="20010">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">风险名称：</label>
                <div class="col-sm-8">
                    <input name="riskName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">所属系统：</label>
                <div class="col-sm-8">
                    <select name="sysId" id="sysId" th:with="item=${@dict.selectHiddenSysList()}" class="form-control" required  onchange="createProList()">
                        <option value="">所有</option>
                        <option th:each="dict : ${item}" th:text="${dict.sysName}"
                                th:value="${dict.sysId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">所属环节：</label>
                <div class="col-sm-8">
                    <select name="linkId" id="linkId" th:with="item=${@dict.selectHiddenLinkList()}" class="form-control" required>
                        <option value="">请选择环节</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">风险等级：</label>
                <div class="col-sm-8">
                    <input name="riskLevel" class="form-control" type="number" required>
                </div>
            </div>
          <!--  <div class="form-group">
                <label class="col-sm-3 control-label">风险要素：</label>
                <div class="col-sm-8">
                    <input name="riskEle" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">作业地点：</label>
                <div class="col-sm-8">
                    <input name="workAddr" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">任务名称：</label>
                <div class="col-sm-8">
                    <input name="taskName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">执行单位：</label>
                <div class="col-sm-8">
                    <input name="executeUnit" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">适用岗位：</label>
                <div class="col-sm-8">
                    <input name="suitPost" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风险等级：</label>
                <div class="col-sm-8">
                    <input name="riskLevel" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风险值：</label>
                <div class="col-sm-8">
                    <input name="riskValue" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风险类型：</label>
                <div class="col-sm-8">
                    <select name="riskType" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风险内容：</label>
                <div class="col-sm-8">
                    <input type="hidden" class="form-control" name="riskContent">
                    <div class="summernote" id="riskContent"></div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风险后果：</label>
                <div class="col-sm-8">
                    <input name="riskResult" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">合格特征：</label>
                <div class="col-sm-8">
                    <input name="passFeature" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">检查周期：</label>
                <div class="col-sm-8">
                    <input name="checkCycle" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">整改措施：</label>
                <div class="col-sm-8">
                    <input name="reformIdea" class="form-control" type="text">
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script th:inline="javascript">
        var prefix = ctx + "hidden/hiddenName"
        $("#form-hiddenName-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-hiddenName-add').serialize());
            }
        }

        function createProList() {
            var _linkId = $("#linkId").empty();
            _linkId.append('<option value="">请选择环节</option>')
            var val = $('#sysId  option:selected').val();
            if(val){
                $.post(ctx+"hidden/hiddenLink/queryLinkList",{sysId:val},function (res) {
                    $.each(res,function (i,item) {
                        _linkId.append(' <option value="'+item.linkId+'">'+item.linkName+'</option>')
                    })
                })
            }
        }
    </script>
</body>
</html>